import java.awt.Color;
import java.awt.Graphics2D;

/**
 *
 * @author Bora SAYINER
 * @since Dec 21, 2014 10:35:42 AM
 * @version 1.0
 */
public class Rectangle extends Shape {

	private int length;

	public Rectangle(int x, int y, int length) {
		super(x, y);
		this.length = length;
	}

	public int getLength() {
		return length;
	}

	@Override
	public void draw(Graphics2D graphics2d) {
		Color originalColor = graphics2d.getColor();
		graphics2d.setColor(Color.BLUE);
		graphics2d.drawRect(getX(), getY(), length, length);
		graphics2d.setColor(originalColor);
	}

}
